<!DOCTYPE html>
<html class="wide wow-animation" lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
  <head>
    <title>Single Product</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script th:src="@{/cdn-cgi/apps/head/3ts2ksMwXvKRuG480KNifJ2_JNM.js}"></script><link rel="icon" th:href="@{/images/favicon.ico}" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700%7CLato%7CKalam:300,400,700">
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/fonts.css}">
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <style>.ie-panel{display: none;background: #212121;padding: 10px 0;box-shadow: 3px 3px 5px 0 rgba(0,0,0,.3);clear: both;text-align:center;position: relative;z-index: 1;} html.ie-10 .ie-panel, html.lt-ie-10 .ie-panel {display: block;}</style>
  </head>
  <body>
    <div class="ie-panel"><a th:href="@{http://windows.microsoft.com/en-US/internet-explorer/}"><img th:src="@{/images/ie8-panel/warning_bar_0000_us.jpg}" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today."></a></div>
    <div class="preloader">
      <div class="preloader-body">
        <div class="cssload-bell">
          <div class="cssload-circle">
            <div class="cssload-inner"></div>
          </div>
          <div class="cssload-circle">
            <div class="cssload-inner"></div>
          </div>
          <div class="cssload-circle">
            <div class="cssload-inner"></div>
          </div>
          <div class="cssload-circle">
            <div class="cssload-inner"></div>
          </div>
          <div class="cssload-circle">
            <div class="cssload-inner"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="page">
      <!-- Page Header-->
      <header class="section page-header">
        <!-- RD Navbar-->
        <div class="rd-navbar-wrap">
          <nav class="rd-navbar rd-navbar-creative rd-navbar-creative-2" data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-fixed" data-xl-layout="rd-navbar-static" data-xl-device-layout="rd-navbar-static" data-xxl-layout="rd-navbar-static" data-xxl-device-layout="rd-navbar-static" data-lg-stick-up-offset="100px" data-xl-stick-up-offset="112px" data-xxl-stick-up-offset="132px" data-lg-stick-up="true" data-xl-stick-up="true" data-xxl-stick-up="true">
            <div class="rd-navbar-collapse-toggle rd-navbar-fixed-element-1" data-rd-navbar-toggle=".rd-navbar-collapse"><span></span></div>
            <div class="rd-navbar-aside-outer">
              <div class="rd-navbar-aside">
                <div class="rd-navbar-collapse">
                  <ul class="contacts-classic">
                    <li><span class="contacts-classic-title">Call us:</span>+(86) 13434985070
                    </li>
                    <li>1057071216@qq.com</li>
                  </ul><a class="rd-navbar-basket rd-navbar-basket-mobile fl-bigmug-line-shopping202" href="#"><span>2</span></a>
                </div>
                <!-- RD Navbar Panel-->
                <div class="rd-navbar-panel">
                  <!-- RD Navbar Toggle-->
                  <button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>
                  <!-- RD Navbar Brand-->
                  <div class="rd-navbar-brand">
                    <!--Brand--><a class="brand" th:href="@{/index.html}"><img class="brand-logo-dark" th:src="@{/images/logohei.jpg}" alt="" width="117" height="41"/><img class="brand-logo-light" th:src="@{/images/logohei.jpg}" alt="" width="117" height="41"/></a>
                  </div>
                </div>
                <div class="rd-navbar-aside-element">
                  <!-- RD Navbar Search-->
                  <div class="rd-navbar-search rd-navbar-search-2">
                    <button class="rd-navbar-search-toggle rd-navbar-fixed-element-3" data-rd-navbar-toggle=".rd-navbar-search"><span></span></button>
                    <form class="rd-search" action="search-results.html" data-search-live="rd-search-results-live" method="GET">
                      <div class="form-wrap">
                        <input class="rd-navbar-search-form-input form-input" id="rd-navbar-search-form-input" type="text" name="s" autocomplete="off"/>
                        <label class="form-label" for="rd-navbar-search-form-input">Search...</label>
                        <div class="rd-search-results-live" id="rd-search-results-live"></div>
                        <button class="rd-search-form-submit fl-bigmug-line-search74" type="submit"></button>
                      </div>
                    </form>
                  </div>
                  <!-- RD Navbar Basket-->
                  <div class="rd-navbar-fixed-element-2 select-inline">
                    <div class="rd-navbar-fixed-element-2 select-inline">
                      <a th:if="${session.user}" class="team-info-figure" th:href="@{/personal-center}">
                        <img th:src="@{${session.user.pictureUrl}}" width=50 height=50>
                      </a>
                      <a th:unless="${session.user}" class="team-info-figure" th:href="@{/personal-center}">
                        <img th:src="@{/img/UserHead/headpicturedefalut.jpg}" width=50 height=50>
                      </a>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="rd-navbar-main-outer">
              <div class="rd-navbar-main">
                <div class="rd-navbar-nav-wrap">
                  <ul class="rd-navbar-nav">
                    <li class="rd-nav-item"><a class="rd-nav-link" th:href="@{/home.html}">首页</a></li>
                    <li class="rd-nav-item"><a class="rd-nav-link" th:href="@{/grid-shop.html}">商城</a></li>
                    <li class="rd-nav-item"><a class="rd-nav-link" th:href="@{/order-page}">求购广场</a></li>
                    <li class="rd-nav-item"><a class="rd-nav-link" th:href="@{/freeshare.html}">免费分享区</a></li>
                    <li class="rd-nav-item"><a class="rd-nav-link" th:href="@{/blog-list.html}">合作推广</a>
                      <ul class="rd-menu rd-navbar-dropdown">
                        <li class="rd-dropdown-item"><a class="rd-dropdown-link" th:href="@{/templates/single-post.html}">我要提建议</a></li>
                        <li class="rd-dropdown-item"><a class="rd-dropdown-link" th:href="@{/templates/single-post.html}">商务合作</a></li>
                      </ul>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </nav>
        </div>
      </header>

      <!-- Single Product-->
      <section class="section section-sm section-first bg-default">
        <div class="container">
          <!--这里-->
          <!-- Bootstrap tabs-->
          <div class="tabs-custom tabs-horizontal tabs-line" id="tabs-1">
            <!-- Nav tabs-->
            <div class="nav-tabs-wrap">
              <ul class="nav nav-tabs nav-tabs-1">
                <li class="nav-item" role="presentation"><a class="nav-link active" href="#tabs-1-1" data-toggle="tab">个人信息</a></li>
                <li class="nav-item" role="presentation"><a class="nav-link" href="#tabs-1-2" data-toggle="tab">我的商品</a></li>
                <li class="nav-item" role="presentation"><a class="nav-link" href="#tabs-1-3" data-toggle="tab">求购</a></li>
               <!-- <li class="nav-item" role="presentation"><a class="nav-link" href="#tabs-1-4" data-toggle="tab">收藏</a></li>-->
              </ul>
            </div>
            <!-- Tab panes-->
            <div class="tab-content tab-content-1">
              <div class="tab-pane fade show active" id="tabs-1-1">

                <form class="rd-form rd-mailform" enctype="multipart/form-data" data-form-output="form-output-global" data-form-type="contact" id="userfrom" th:action="@{/updateuser}" method="post">
                  <div class="row row-20 row-md-30">

                    <div class="col-lg-8">
                      <div class="row row-20 row-md-30">

                        <div class="col-sm-6">
                          <div class="form-wrap">
                            <input th:if="${user.name}" class="form-input" th:placeholder="${user.name}" th:id="contact-first-name-2" type="text" name="name" data-constraints="@Required"/>
                            <input th:unless="${user.name}" class="form-input" placeholder="用户名" th:id="contact-first-name-2" type="text" name="name" data-constraints="@Required"/>

                            <label class="form-label" for="contact-first-name-2"></label>
                          </div>
                        </div>

                        <div class="col-sm-6">
                          <div class="form-wrap">
                            <input th:if="${user.sex}" class="form-input" th:placeholder="${user.sex}" th:id="contact-last-name-2" type="text" name="sex" data-constraints="@Required"/>
                            <input th:unless="${user.sex}" class="form-input" placeholder="性别" th:id="contact-last-name-2" type="text" name="sex" data-constraints="@Required"/>
                            <label class="form-label" for="contact-last-name-2"></label>
                          </div>
                        </div>

                        <div class="col-sm-6">
                          <div class="form-wrap">
                            <input th:if="${user.address}" class="form-input" th:placeholder="${user.address}" th:id="contact-address-2" type="text" name="address" data-constraints="@Numeric"/>
                            <input th:unless="${user.address}" class="form-input" placeholder="地址" th:id="contact-address-2" type="text" name="address" data-constraints="@Numeric"/>
                            <label class="form-label" for="contact-address-2" ></label>
                          </div>
                        </div>

                        <div class="col-sm-6">
                          <div class="form-wrap">
                            <input class="form-input" placeholder="密码" id="contact-password-2" type="text" name="password" data-constraints="@Numeric"/>
                            <label class="form-label" for="contact-password-2"></label>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="form-wrap">
                            <input th:if="${user.phone}" class="form-input" th:placeholder="${user.phone}" th:id="contact-phone-2" type="text" name="phone" data-constraints="@Numeric"/>
                            <input th:unless="${user.phone}" class="form-input" placeholder="手机号" th:id="contact-phone-2" type="text" name="phone" data-constraints="@Numeric"/>
                            <label class="form-label" for="contact-phone-2"></label>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="form-wrap">
                            <input th:if="${user.wechat}" class="form-input" th:placeholder="${user.wechat}" th:id="contact-wechat-2" type="text" name="wechat" data-constraints="@Numeric"/>
                            <input th:unless="${user.wechat}" class="form-input" placeholder="微信号" th:id="contact-wechat-2" type="text" name="wechat" data-constraints="@Numeric"/>
                            <label class="form-label" for="contact-wechat-2"></label>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="form-wrap">
                            <input th:if="${user.qq}" class="form-input" th:placeholder="${user.qq}" th:id="contact-qq-2" type="text" name="qq" data-constraints="@Numeric"/>
                            <input th:unless="${user.qq}" class="form-input" placeholder="QQ号" th:id="contact-qq-2" type="text" name="qq" data-constraints="@Numeric"/>
                            <label class="form-label" for="contact-qq-2"></label>
                          </div>
                        </div>

                    </div>
                    <!--这里放图片-->

                  </div>

                  <div class="col-lg-4">
                    <div class="form-wrap">
                      <div >
                        <img th:if="${session.user.pictureUrl}" th:src="@{${session.user.pictureUrl}}" width=150 height=150 th:id="previewimg">
                        <img th:unless="${session.user.pictureUrl}" th:src="@{/img/UserHead/headpicturedefalut.jpg}" th:id="previewimg" width=500 height=500></div>
                      <div >
                        <input type="file" id="img" name="img" onChange="preview(this)"/>
                      </div>
                      <script type="text/javascript">
                        function preview(obj){
                          var img = document.getElementById("previewimg");
                          img.src = window.URL.createObjectURL(obj.files[0]);
                        }
                      </script>
                    </div>
                  </div>

                  </div>
                  <button class="button button-lg button-primary button-zakaria" type="button" id="usercombtn">提   交</button>
                  <script>
                    document.getElementById("usercombtn").onclick = function (){
                      document.getElementById("userfrom").submit() ;
                    }
                  </script>
                </form>

              </div>
              <!--  商品发布页  根据用户 的 id 去查询该用户发布的商品 返回的是 商品的 id -->
              <div class="tab-pane fade" id="tabs-1-2">
                <div class="single-product-info">
                  <div align = "right">
                    <a th:href="@{/shoprelease.html}">
                      <button class="button button-lg button-primary button-zakaria" type="submit">发布商品</button>
                    </a>
                  </div>
                  <div class="unit unit-spacing-md flex-column flex-sm-row align-items-sm-center">
                    <div class="unit-body">

                      <div class="col-12" >
                        <div class="row row-30">
                          <div class="col-sm-auto" th:each="item:${items}">
                            <article class="product">
                              <div class="product-body">
                                <div class="product-figure"><img th:src="@{/img/ComPicture/{pi}.jpg(pi=${item.id})}" alt="" width="155" height="145"/>
                                </div>
                                <h5 class="product-title"><a th:href="@{/single-product.html}" th:text="${item.name}">Sparkling drinks</a></h5>
                                <div class="product-price-wrap">
                                  <div class="product-price" th:text="${item.price}">$13.00</div>
                                </div>
                              </div>
                              <div th:if="${item.status} eq '1'">
                                <span class="product-badge product-badge-sale">已售</span>
                              </div>
                              <div th:if="${item.status} ne '1'">
                                <span class="product-badge product-badge-new">待售</span>
                              </div>
                              <div class="product-button-wrap">
                                <div class="product-button"><a class="button button-secondary button-zakaria fl-bigmug-line-search74"  title="修改商品" th:href="@{/modifyrelease.html?id={id}(id=${item.id})}"></a></div> <!-- th:href="@{/single-product.html?id={id}(id=${item.id})}" -->
                                <div class="product-button"><a class="button button-primary button-zakaria fl-bigmug-line-checkmark15"  title="已完成交易" th:href="@{/setCommodityStatus/}+${item.getId()}"></a></div>
                                <div class="product-button"><a class="button button-primary button-zakaria fl-bigmug-line-close42"  title="删除商品" th:href="@{/delete/}+${item.getId()}"></a></div>
                              </div>
                            </article>
                          </div>
                        </div>
                      </div>

                    </div>
                  </div>
                </div>
              </div>

              <div class="tab-pane fade" id="tabs-1-3">
                <div class="single-product-info">
                  <div align = "right">
                    <a th:href="@{/shopdemand.html}">
                      <button class="button button-lg button-primary button-zakaria" type="submit">发布求购</button>
                    </a>
                  </div>
                  <div class="unit unit-spacing-md flex-column flex-sm-row align-items-sm-center">
                    <div class="unit-body">
                      <!---->
                      <!---->
                      <div class="col-12">
                        <h6 class="single-post-title">我的求购</h6>
                        <div class="row row-30">

                          <div class="col-sm-auto" th:each="demand:${demands}">
                            <!-- Post Classic-->
                            <article class="product"><a class="post-classic-figure" th:href="@{/templates/single-post.html}"><img th:src="@{/img/OrderPicture/{pi}.jpg(pi=${demand.id})}"  alt="待上传" width="155" height="145"/></a>
                              <div class="post-classic-content">
                                <div class="post-classic-time">
                                  <time datetime="2020-09-08" th:text="${demand.btime}">August 9, 2020</time>
                                </div>
                                <h5 class="post-classic-title"><div th:href="@{/templates/single-post.html}" th:text="${demand.find_name}">Breakfast Potatoes (Crispy + Tender)</div></h5>
                                <p class="post-classic-text" th:text="${demand.content}">Est velox nuptia, cesaris. Est dexter turpis, cesaris. Cum nixus persuadere, omnes fluctuies promissio flavum</p>
                              </div>

                              <div th:if="${demand.status} eq '1'">
                              <span class="product-badge product-badge-sale">已完成</span>
                              </div>
                              <div th:if="${demand.status} ne '1'">
                                <span class="product-badge product-badge-new">待完成</span>
                              </div>
                              <div class="product-button-wrap">
                                <div class="product-button">
                                  <a class="button button-secondary button-zakaria fl-bigmug-line-search74"  title="修改求购信息" th:href="@{/modifydemand.html?id={id}(id=${demand.id})}"></a>
<!--                                  @{/modifydemand.html?id={id}(id=${demand.id})}-->
                                </div>
                                <div class="product-button">
                                  <a class="button button-primary button-zakaria fl-bigmug-line-checkmark15" title="已完成求购" th:href="@{/setOrderStatus/}+${demand.getId()}"></a>
                                </div>
                                <div class="product-button">
                                  <a class="button button-primary button-zakaria fl-bigmug-line-close42" title="删除求购信息" th:href="@{/deletedemand/}+${demand.getId()}"></a>
                                </div>

                              </div>
                            </article>
                          </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>


              </div>
          </div>
        </div>
      </section>
      <!-- Related Products-->
      <!-- Page Footer-->
    </div>
    <div class="snackbars" id="form-output-global"></div>
    <script th:src="@{/js/core.min.js}"></script>
    <script th:src="@{/js/script.js}"></script>
  </body>
</html>